<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
<script>

try{
    test();
}catch (error){
	if (error instanceof TypeError){
	  //处理类型错误
	}else if (error instanceof ReferenceError){
	  //处理引用类型
	}else{
	  //处理其他类型错误
	}
}


</script>
</head>
<body>
</body>
</html> 



